<html>

<head>
    <style>
        *{
            padding: 0;
        }
        #cont {
            height: 5000px;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="cont">
        <svg id="path" version="1.1" xmlns="http://www.w3.org/2000/svg" width="500" height="5000" viewBox="0 0 500 5000"
            fill="none" stroke-width="5">
            <path stroke="red" d="M100,250H400L200,5000" />
        </svg>
    </div>

</body>
<script src="https://cdn.jsdelivr.net/g/jquery@1.11.3,jquery.easing@1.3(jquery.easing.1.3.min.js)"></script>
<script src="../jquery-drawsvg-master/public/jquery.drawsvg.js"></script>
<script>
    $(function () {
        var svg = $('#path');
        console.log('svg==>', svg);
        svg.drawsvg({
            callback: () => {
                console.log('playcomplete');
            },
        });
        // svg.drawsvg('animate');
        
        var $doc = $(document);
        var $win = $(window);
        console.log(max,$doc.height(),$win.height(),$win,$doc);
        var max = $doc.height()-window.screen.height;
        
        $win.on('scroll',function(){
            var p = $win.scrollTop()/max;
            svg.drawsvg('progress',p);
        })
    })
</script>

</html>